package leetcode.code0027;

import leetcode.IDebug;
import leetcode.helper.HelpDebug;

public abstract class Solution27 implements IDebug {

	public abstract int removeElement(int[] nums, int val);

	@Override
	public void debug1() {
		String str1 = "[3,2,2,3]";
		int val = 3;
		int e = 2;
		String str2 = "[2,2]";
		debug(str1, val, str2, e);
	}

	private void debug(String str1, int val, String str2, int e) {
		int[] nums = HelpDebug.str2array3(str1);
		int r = this.removeElement(nums, val);
		int[] res = HelpDebug.str2array3(str2);
		HelpDebug.compare(e, r);
		HelpDebug.compare(res, nums);
	}

	@Override
	public void debug2() {
		String str1 = "[0,1,2,2,3,0,4,2]";
		int val = 2;
		int e = 5;
		String str2 = "[0,1,4,0,3]";
		debug(str1, val, str2, e);
	}

	@Override
	public void debug3() {

	}

	@Override
	public void debug4() {

	}

}
